*Replication code for the 2020 pilot study in "Recocking with Reality: Correcting National Overconfidence in a Rising Power" by Haifeng Huang

*Prepared in August 2025


/****** Variables

pew1: respondents' answers about Pew survey result 1 (US, Canada, and West Europe), with correct answers coded as 0 and overestimates (underestimates) coded as positive (negative) values
pew2: respondents' answers about Pew survey result 2 (Asia, Africa, and Latin America), with correct answers coded as 0 and overestimates (underestimates)  coded as positive (negative) value
gallup: respondents' answers about Gallup World Poll result, with correct answers coded as 0 and overestimates (underestimates) coded as positive (negative) values
hongkong: respondents' answers about the Hong Kong poll result, with correct answers coded as 0 and overestimates (underestimates) coded as positive (negative) values
taiwan: respondents' answers about the Taiwan poll result, with correct answers coded as 0 and overestimates (underestimates) coded as positive (negative) values
bravo: respondents' answers about IMDb rating of the documentary Amazing China, with correct answers coded as 0 and overestimates (underestimates) coded as positive (negative) values

selfimage_ct: net number of overestimating responses

female: 0 or 1
age: age group
age_scaled: age group rescaled to range from 0 to 1
education: education level ranging from 1 (primary school or below) to 6 (graduate school)
education_scaled: education level rescaled to range ranging from 0 to 1 
income: income status
income_scaled: income status rescaled to range from 0 to 1
life: life satisfaction
life_scaled: life satisfaction rescaled to range from 0 to 1
pinterest: political interest
pinterest_scaled: political interest rescaled to range from 0 to 1
ccpmember: membership in the Chinese Communist Party (0 or 1)

pride: degree of pride for being a Chinese
pride_scaled: pride rescaled to range from 0 to 1
citizenship: whether one will choose Chinese citizenship over any other citizenship in the world
citizenship_scaled: citizenship rescaled to range from 0 to 1
nationalism: (citizenship_scaled + pride_scaled)/2

nationalstatemedia: national state media as a major information source (0 or 1)
localstatemedia: local state media as a major information source (0 or 1)
commercialmedia: commercial media as a major information source (0 or 1)
socialmedia: social media as a major information source (0 or 1)
foreignmedia: foreign media as a major information source (0 or 1)
personalcommunication: interpersonal communication as a major information source (0 or 1)

visitdeveloped: had experience visiting developed countris (0 or 1)
visitdeveloping: had experience visiting developing countris (0 or 1)
visithmt: had experience visiting Hong Kong, Macao, or Taiwan (0 ot 1)

region: eastern China (3), central China (2), or western China (1)
occupation: respondent's occupation

******/



********** Figure 1 **********

clear

use overconfidence2020.dta

grstyle init
grstyle set plain
grstyle color background white
grstyle clockdir legend_position 12
grstyle linestyle legend none


hist pew1, discrete percent  width(0.5)  xlabel(-1 "22%" 0 "35%" 1 "48%" 2 "61%" 3 "74%" 4 "87%") xtitle("(C) U.S., Canada, and W. Europe: Positive Views of China", margin(small)) bcolor(gray) text(19.5 0 "correct", color(black)) text(39.5 2 "median",  color(black))

graph save 2020_pew1_C_median.gph, replace 


hist pew2, discrete percent  width(0.5)  xlabel(-2 "20%" -1 "33%" 0 "46%" 1 "59%" 2 "72%" 3 "85%") xtitle("(D) Asia, Africa, and L. America: Positive Views of China", margin(small)) bcolor(gray)  text(21 0 "correct", color(black)) text(34.2 1 "median", color(black))

graph save 2020_pew2_D_median.gph, replace


hist gallup, discrete percent  width(0.5)  xlabel(-1 "19%" 0 "34%" 1 "49%" 2 "64%" 3 "79%" 4 "94%") xtitle("(E) World: Approval of China's Leadership", margin(small)) bcolor(gray) text(12 0 "correct", color(black)) text(43.7 2 "median", color(black))

graph save 2020_gallup_e_median.gph, replace


histogram taiwan, discrete percent width(0.5)  xlabel(0 "12.9%" 1 "28.9%" 2 "44.9%" 3 "60.9%" 4 "76.9%" 5 "92.9%") xtitle("(B) Taiwan: Support for Reunification with Mainland China", margin(small)) bcolor(gray) text(13 0 "correct", color(black)) text(26.8 3 "median", color(black))

graph save 2020_taiwan_b_median.gph, replace


histogram hongkong, discrete percent  width(0.5)  xlabel(-1 "5.6%" 0 "22.6%" 1 "39.6%" 2 "56.6%" 3 "73.6%" 4 "90.6%") xtitle("(A) Hong Kong: Positive Views of Mainland Government", margin(small)) bcolor(gray) text(15.5 0 "correct", color(black)) text(31 2 "median", color(black))

graph save 2020_hongkong_a_median.gph, replace


hist bravo, discrete percent  width(0.5)  xlabel(0 "1.3" 1 "2.9" 2 "4.5" 3 "6.1" 4 "7.7" 5 "9.3")  xtitle("(F) IMDb: Rating of Amazing China", margin(small)) bcolor(gray)  text(8 0 "correct", color(black)) text(39 4 "median", color(black))

graph save 2020_bravo_f_median.gph, replace


graph combine 2020_hongkong_a_median.gph 2020_taiwan_b_median.gph 2020_pew1_c_median.gph 2020_pew2_d_median.gph 2020_gallup_e_median.gph 2020_bravo_f_median.gph, rows(3)

graph save 2020_selfimage_median_hkfirst, replace


grstyle clear
eststo clear


********** Figure A1 **********

clear

use overconfidence2020.dta

grstyle init
grstyle set plain
grstyle color background white
grstyle clockdir legend_position 12
grstyle linestyle legend none


eststo s1:  quietly reg selfimage_ct female age_scaled education_scaled income_scaled  ccpmember life_scaled pinterest_scaled nationalstatemedia localstatemedia commercialmedia socialmedia foreignmedia personalcommunication visitdeveloped visitdeveloping visithmt, robust  


coefplot s1, drop(_cons) xline(0, lpattern(dash) lcolor(black) lwidth(thin))  byopts(graphregion(fcolor(white))) ///
levels(95)  legend(off) 

graph save 2020_selfimage_correlates_ct, replace


grstyle clear

eststo clear



********** Figure A2 **********

clear

use overconfidence2020.dta

reg nationalism selfimage_ct i.female age_scaled education_scaled income_scaled  i.ccpmember life_scaled pinterest_scaled i.nationalstatemedia i.localstatemedia i.commercialmedia i.socialmedia i.foreignmedia i.personalcommunication i.visitdeveloped i.visitdeveloping i.visithmt  

margins, at(selfimage_ct=(-4(1)6)) 
marginsplot, ytitle(Nationalism) xtitle(National Selfimage (Net Number of Overestimating Responses)) title("")

graph save nationalism_2020, replace


clear

exit
